<?php
class newPublicationPriceForm extends BasePublicationPriceForm{
	public function configure(){
		if(!$this->getObject()->getPublication()->getId()){
			throw  new Exception("only add in Exist Publication");
		}
		$percentageTypes=PublicationPriceTable::getPercentageTypes();
		//$this->widgetSchema["fees_qty"]= new sfWidgetFormInputText();
		$this->widgetSchema["percentage_type"]= new sfWidgetFormChoice(array("choices"=>$percentageTypes,"expanded"=>true),array("class"=>"jq_radio"));
		
		$this->validatorSchema["percentage_type"]= new sfValidatorChoice(array("choices"=>array_keys($percentageTypes)));
		
		$this->validatorSchema["num_prices"]= new sfValidatorNumber(array("max"=>100,"min"=>0));
		
		$this->useFields(array("price_type_id","description","percentage_type","percentage","num_prices"));
	}
}